package day06;

import java.util.Scanner;

public class MainTest2 {
    public static void main(String[] args) {
        // 循环录入有5个班各有5名学生某门课程成绩
        // 如何计算5个班各自的总成绩
        // 双重循环、二维数组
        int[][] num = new int[5][5];

        Scanner input = new Scanner(System.in);
        for (int i =0; i< num.length;i++){
            int sum = 0;
            for (int j =0;j< num[i].length;j++){
                System.out.println("请第"+(i+1)+"个班的第"+(j+1)+"位同学输入成绩:");
                num[i][j] = input.nextInt();
                sum =sum +num[i][j];
            }
            System.out.println("第"+(i+1)+"个班的总分："+sum);
        }
    }
}
